<#import "../tpl/pageTep.ftl" as page>
<@page.pageBase currentMenu="检测项目管理">
<div class="xm-product">
    <div class="row">
        <div class="panel">
            <div class="panel-header">
                <a href="${basepath}/rest/manage/testproject/toList">返回上一级</a>
            </div>
            <div class="panel-body demo-content">
                <form id="addForm" class="form-horizontal" action="${basepath}/rest/manage/testproject/insertJson"
                      method="post">
                    <div class="control-group">
                        <label class="control-label">
                            <s>*</s>
                            检测对象：
                        </label>
                        <div class="controls">
                            <div id="p-catalog">
                                <input type="hidden" id="p-value"  name="categoryID" data-rules="{required : true}">
                            </div>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            <s>*</s>
                            检测项目：
                        </label>
                        <div class="controls">
                            <input type="text" class="control-text span-width span8" name="name"
                                   data-rules="{required : true}" placeholder="请填写检测项目">
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label">
                            价格：
                        </label>

                        <div class="controls">
                            <input type="text" class="control-text span-width span8" name="price" placeholder="请填写价格">
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            <s>*</s>
                            方法依据：
                        </label>

                        <div class="controls">
                            <input type="text" class="control-text span-width span8" name="accordingTo" placeholder="请填写方法依据"
                                   data-rules="{required : true}">
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            <s>*</s>
                            检出限：
                        </label>

                        <div class="controls">
                            <input type="text" class="control-text span-width span8" name="detectionLimit" placeholder="请填写检出限"
                                   data-rules="{required : true}">
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            <s>*</s>
                            检出限单位：
                        </label>

                        <div class="controls">
                            <input type="text" class="control-text span-width span8" name="detectionLimitUnit" placeholder="请填写检出限单位"
                                   data-rules="{required : true}">
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            <s>*</s>
                            资质：
                        </label>
                        <div class="controls">
                            <input type="text" class="control-text span-width span8" name="aptitude" placeholder="请填写资质"
                                   data-rules="{required : true}">
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            <s>*</s>
                            检测方法：
                        </label>
                        <div class="controls">
                            <input type="text" class="control-text span-width span8" name="testMethod" placeholder="请填写检测方法"
                                   data-rules="{required : true}">
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            备注：
                        </label>
                        <div class="controls  control-row-auto">
                            <textarea   name="remark" placeholder="请填写备注"
                                        style="width: 400px;"></textarea>
                        </div>
                    </div>
                    <div class="centered">
                        <button type="submit" class="button  button-large  button-success">保存</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    var Select = BUI.Select;
    var Store = BUI.Data.Store;
    var addForm = new BUI.Form.Form({
        srcNode: '#addForm',
        submitType: 'ajax',
        callback: function (data) {
            if (data.success == true) {
                window.location.href='${basepath}/rest/manage/testproject/toList';
            } else {
                BUI.Message.Alert(data.message, 'error');
                return;
            }
        }
    }).render();
    //查询检测项目信息
    var pStore = new Store({
        url: '${basepath}/rest/manage/testprojectcategory/selectAllList',
        autoLoad: true,
        root: 'data'
    });
    var pSelect = new Select.Select({
        render: '#p-catalog',
        valueField: '#p-value',
        list: {
            itemTpl: '<li>{name}</li>',
            idField: 'id'
        },
        store: pStore
    }).render();
</script>

</@page.pageBase>
